﻿namespace ctolua.Models
{
    public class MModel
    {
        /// <summary>
        /// 模型
        /// </summary>
        public Model model { get; set; }
        /// <summary>
        /// 创建模型
        /// </summary>
        /// <param name="model_key ">  模型编号   </param>
        /// <param name="pos ">  点   </param>
        /// <param name="face ">  朝向   </param>
        /// <returns>模型</returns>
        public MModel(int? model_key, Point pos, double face)
        {
            this.model = game_api.create_model_in_scene(model_key, pos, py.Fix32(face));
        }
        /// <summary>
        /// 创建展示模型，面向点，朝向实数
        /// </summary>
        /// <param name="model_res_id ">  模型名称   </param>
        /// <param name="position ">  点   </param>
        /// <param name="rotation ">  朝向   </param>
        /// <returns>模型</returns>
        public MModel(int? model_res_id, Point position, double? rotation)
        {
            this.model = game_api.create_model_on_point(model_res_id, position, rotation);
        }
        /// <summary>
        /// 删除模型
        /// </summary>
        public void del()
        {
            game_api.delete_model_entity(this.model);
        }
        /// <summary>
        /// 销毁模型
        /// </summary>
        public void destroy()
        {
            game_api.destroy_model_in_scene(this.model);
        }


    }
}
